package com.example.psychologicalappointmentsystem.Enum;


public enum OrderType {
    ONLINE("ONLINE", "0", "线上"),
    OFFLINE("OFFLINE", "1", "线下");

    private String name;
    private String value;
    private String remark;

    public String getRemark() {
        return remark;
    }

    OrderType(String name, String value, String remark) {
        this.name = name;
        this.value = value;
        this.remark = remark;
    }

    // 添加一个静态方法用于通过描述查找枚举实例
    public static OrderType fromDescription(String description) {
        for (OrderType orderType : values()) {
            if (orderType.getRemark().equals(description)) {
                return orderType;
            }
        }
        throw new IllegalArgumentException("No enum constant with description: " + description);
    }

    public static void main(String[] args) {
        OrderType orderType = OrderType.fromDescription("线上");
        System.out.println(orderType);
    }
}
